
<%
	response.setHeader("Pragma", "No-cache");
	response.setHeader("Cache-Control", "no-cache");//HTTP 1.0
	response.setHeader("Expires", "0");
%>

<%@ page contentType="text/html;charset=UTF-8" language="java"%>

<%@page import="com.bluesky.plum.uimodels.render.html.PMEServlet"%>
<%@page
	import="com.bluesky.plum.uimodels.render.html.components.containers.window.*"%>
<%@page
	import="com.bluesky.plum.uimodels.standard.StandardApplicationUIBuilder"%>
<%@page
	import="com.bluesky.plum.uimodels.standard.components.containers.window.MainWindow"%>
<%@page import="com.bluesky.javawebbrowser.domain.html.tags.Tag"%>
<%@page
	import="com.bluesky.plum.uimodels.standard.components.containers.window.WindowManager"%>
<%@page
	import="com.bluesky.plum.uimodels.standard.components.containers.window.Window"%>
<%@page import="org.springframework.context.ApplicationContext"%>
<%@page
	import="com.bluesky.plum.util.SpringFrameworkUtil"%>

<%
	HMainWindow mainWindow = (HMainWindow) request.getSession()
			.getAttribute(PMEServlet.OUM_MainWindow);
	if (mainWindow == null) {
		//get Spring bean factory, get the business objects
		ServletContext servletContext = getServletContext();
		ApplicationContext appCtx = SpringFrameworkUtil
				.getWebApplicationContext(servletContext);
SpringFrameworkUtil.registerRepositories(appCtx);
		mainWindow = (HMainWindow) StandardApplicationUIBuilder
				.createSampleUIOfHtml(SpringFrameworkUtil
						.getBusinessObjectPairs(appCtx));
		request.getSession().setAttribute(PMEServlet.OUM_MainWindow,
				mainWindow);
		//mainWindow.getRootWindow().setVisible(true);

	}
%>
<html>



<body>
<%
	WindowManager wm = mainWindow.getWindowManager();
	System.out.println("window manager:" + wm);

	Window frontWindow = wm.getVisibleFontWindow();
	System.out.println("front window:" + frontWindow);
%>
<%=mainWindow.render()%>
</body>

<script type="text/javascript">
	function _oum_post(component, event) {

		//alert(component.name+'.'+event);
		component.form._event_name.value = event;
		component.form._component_id.value = component.name;

		component.form.submit();
	}
</script>
</html>